<div class="divColorbox">
    <div class="divColorbox_Header">
        <span><i class="fa fa-star"></i><span>直播单据信息</span></span>
        <a class="Refresh"></a><a class="Close"></a>
    </div>
    <div class="divColorbox_Body row">
        <ul id="MenuTabs" class="nav nav-tabs">
            <li><a data-toggle="tab" href="#MenuTabs_Base">基本信息</a></li>
            <li><a data-toggle="tab" href="#MenuTabs_Gift">礼物信息</a></li>
            <li><a data-toggle="tab" href="#MenuTabs_Guardian">守护信息</a></li>
            <li><a data-toggle="tab" href="#MenuTabs_Horn">喇叭信息</a></li>
        </ul>
        <div class="tab-content">
            <div id="MenuTabs_Base" class="tab-pane">
                <div class="row">
                    <div class="col-sm-6">
                        <div class="input-group">
                            <span class="input-group-addon">单据号</span>
                            <input id="Order_No" type="text" class="form-control" readonly/>
                        </div>
                    </div>
                    <div class="col-sm-3">
                        <div class="input-group">
                            <span class="input-group-addon">直播方式</span>
                            <input id="IsMobile" type="text" class="form-control" readonly/>
                        </div>
                    </div>
                    <div class="col-sm-3">
                        <div class="input-group">
                            <span class="input-group-addon">直播状态</span>
                            <input id="Status" type="text" class="form-control" readonly/>
                        </div>
                    </div>
                </div>
                <div class="space-6"></div>
                <div class="row">
                    <div class="col-sm-6">
                        <div class="input-group">
                            <span class="input-group-addon">用户ID</span>
                            <input id="User_ID" type="text" class="form-control" readonly/>
                            <span class="input-group-btn">
                                <a id="btnUserInfo" class="btn btn-default btn-sm" data-permission-code="{User}[Base](Info)" data-rel="tooltip" data-placement="left" data-original-title="查看用户">
                                    <i class="fa fa-search"></i>
                                </a>
                            </span>
                        </div>
                    </div>
                    <div class="col-sm-3">
                        <div class="input-group">
                            <span class="input-group-addon">昵称</span>
                            <input id="NickName" type="text" class="form-control" readonly/>
                        </div>
                    </div>
                    <div class="col-sm-3">
                        <div class="input-group">
                            <span class="input-group-addon">真实姓名</span>
                            <input id="RealName" type="text" class="form-control" readonly/>
                        </div>
                    </div>
                </div>
                <div class="space-6"></div>
                <div class="row">
                    <div class="col-sm-2">
                        <div class="input-group">
                            <span class="input-group-addon">总金币</span>
                            <input id="Coin" type="text" class="form-control" readonly/>
                        </div>
                    </div>
                    <div class="col-sm-2">
                        <div class="input-group">
                            <span class="input-group-addon">艺人收入</span>
                            <input id="Beans_Anchor" type="text" class="form-control" readonly/>
                        </div>
                    </div>
                    <div class="col-sm-2">
                        <div class="input-group">
                            <span class="input-group-addon">艺人公会收入</span>
                            <input id="Beans_Family" type="text" class="form-control" readonly/>
                        </div>
                    </div>
                    <div class="col-sm-2">
                        <div class="input-group">
                            <span class="input-group-addon">用户收入</span>
                            <input id="Beans_User" type="text" class="form-control" readonly/>
                        </div>
                    </div>
                    <div class="col-sm-2">
                        <div class="input-group">
                            <span class="input-group-addon">用户公会收入</span>
                            <input id="Beans_UserFamily" type="text" class="form-control" readonly/>
                        </div>
                    </div>
                    <div class="col-sm-2">
                        <div class="input-group">
                            <span class="input-group-addon">平台收入</span>
                            <input id="Beans_Platform" type="text" class="form-control" readonly/>
                        </div>
                    </div>
                </div>
                <div class="space-6"></div>
                <div class="row">
                    <div class="col-sm-4">
                        <div class="input-group">
                            <span class="input-group-addon">礼物数量</span>
                            <input id="Gift_Num" type="text" class="form-control" readonly/>
                        </div>
                    </div>
                    <div class="col-sm-4">
                        <div class="input-group">
                            <span class="input-group-addon">艺人礼物数量</span>
                            <input id="Gift_Num_Anchor" type="text" class="form-control" readonly/>
                        </div>
                    </div>
                    <div class="col-sm-4">
                        <div class="input-group">
                            <span class="input-group-addon">用户礼物数量</span>
                            <input id="Gift_Num_User" type="text" class="form-control" readonly/>
                        </div>
                    </div>
                </div>
                <div class="space-6"></div>
                <div class="row">
                    <div class="col-sm-4">
                        <div class="input-group">
                            <span class="input-group-addon">礼物次数</span>
                            <input id="Gift_Count" type="text" class="form-control" readonly/>
                        </div>
                    </div>
                    <div class="col-sm-4">
                        <div class="input-group">
                            <span class="input-group-addon">艺人礼物次数</span>
                            <input id="Gift_Count_Anchor" type="text" class="form-control" readonly/>
                        </div>
                    </div>
                    <div class="col-sm-4">
                        <div class="input-group">
                            <span class="input-group-addon">用户礼物次数</span>
                            <input id="Gift_Count_User" type="text" class="form-control" data-rel="tooltip" readonly/>
                        </div>
                    </div>
                </div>
                <div class="space-6"></div>
                <div class="row">
                    <div class="col-sm-4">
                        <div class="input-group">
                            <span class="input-group-addon">礼物金币</span>
                            <input id="Gift_Coin" type="text" class="form-control" readonly/>
                        </div>
                    </div>
                    <div class="col-sm-4">
                        <div class="input-group">
                            <span class="input-group-addon">艺人礼物金币</span>
                            <input id="Gift_Coin_Anchor" type="text" class="form-control" readonly/>
                        </div>
                    </div>
                    <div class="col-sm-4">
                        <div class="input-group">
                            <span class="input-group-addon">用户礼物金币</span>
                            <input id="Gift_Coin_User" type="text" class="form-control" readonly/>
                        </div>
                    </div>
                </div>
                <div class="space-6"></div>
                <div class="row">
                    <div class="col-sm-3">
                        <div class="input-group">
                            <span class="input-group-addon">艺人礼物收入</span>
                            <input id="Gift_Beans_Anchor" type="text" class="form-control" data-rel="tooltip" readonly/>
                        </div>
                    </div>
                    <div class="col-sm-3">
                        <div class="input-group">
                            <span class="input-group-addon">艺人公会收入</span>
                            <input id="Gift_Beans_Family" type="text" class="form-control" readonly/>
                        </div>
                    </div>
                    <div class="col-sm-3">
                        <div class="input-group">
                            <span class="input-group-addon">用户礼物收入</span>
                            <input id="Gift_Beans_User" type="text" class="form-control" readonly/>
                        </div>
                    </div>
                    <div class="col-sm-3">
                        <div class="input-group">
                            <span class="input-group-addon">用户公会礼物收入</span>
                            <input id="Gift_Beans_UserFamily" type="text" class="form-control" readonly/>
                        </div>
                    </div>
                </div>
                <div class="space-6"></div>
                <div class="row">
                    <div class="col-sm-3">
                        <div class="input-group">
                            <span class="input-group-addon">平台礼物收入</span>
                            <input id="Gift_Beans_Platform" type="text" class="form-control" data-rel="tooltip" readonly/>
                        </div>
                    </div>
                    <div class="col-sm-3">
                        <div class="input-group">
                            <span class="input-group-addon">爆奖次数</span>
                            <input id="Gift_Pond_Count" type="text" class="form-control" readonly/>
                        </div>
                    </div>
                    <div class="col-sm-3">
                        <div class="input-group">
                            <span class="input-group-addon">爆奖金币</span>
                            <input id="Gift_Pond_Coin" type="text" class="form-control" readonly/>
                        </div>
                    </div>
                    <div class="col-sm-3">
                        <div class="input-group">
                            <span class="input-group-addon">守护次数</span>
                            <input id="Guardian_Count" type="text" class="form-control" readonly/>
                        </div>
                    </div>
                </div>
                <div class="space-6"></div>
                <div class="row">
                    <div class="col-sm-3">
                        <div class="input-group">
                            <span class="input-group-addon">守护金币</span>
                            <input id="Guardian_Coin" type="text" class="form-control" data-rel="tooltip" readonly/>
                        </div>
                    </div>
                    <div class="col-sm-3">
                        <div class="input-group">
                            <span class="input-group-addon">守护艺人收入</span>
                            <input id="Guardian_Beans_Anchor" type="text" class="form-control" readonly/>
                        </div>
                    </div>
                    <div class="col-sm-3">
                        <div class="input-group">
                            <span class="input-group-addon">守护公会收入</span>
                            <input id="Guardian_Beans_Family" type="text" class="form-control" readonly/>
                        </div>
                    </div>
                    <div class="col-sm-3">
                        <div class="input-group">
                            <span class="input-group-addon">守护平台收入</span>
                            <input id="Guardian_Beans_Platform" type="text" class="form-control" readonly/>
                        </div>
                    </div>
                </div>
                <div class="space-6"></div>
                <div class="row">
                    <div class="col-sm-3">
                        <div class="input-group">
                            <span class="input-group-addon">喇叭次数</span>
                            <input id="Horn_Count" type="text" class="form-control" data-rel="tooltip" readonly/>
                        </div>
                    </div>
                    <div class="col-sm-3">
                        <div class="input-group">
                            <span class="input-group-addon">喇叭金币</span>
                            <input id="Horn_Coin" type="text" class="form-control" readonly/>
                        </div>
                    </div>
                    <div class="col-sm-3">
                        <div class="input-group">
                            <span class="input-group-addon">喇叭艺人收入</span>
                            <input id="Horn_Beans_Anchor" type="text" class="form-control" readonly/>
                        </div>
                    </div>
                    <div class="col-sm-3">
                        <div class="input-group">
                            <span class="input-group-addon">喇叭公会收入</span>
                            <input id="Horn_Beans_Family" type="text" class="form-control" readonly/>
                        </div>
                    </div>
                </div>
                <div class="space-6"></div>
                <div class="row">
                    <div class="col-sm-3">
                        <div class="input-group">
                            <span class="input-group-addon">喇叭平台收入</span>
                            <input id="Horn_Beans_Platform" type="text" class="form-control" data-rel="tooltip" readonly/>
                        </div>
                    </div>
                    <div class="col-sm-3">
                        <div class="input-group">
                            <span class="input-group-addon">柠檬数量</span>
                            <input id="Pomelo" type="text" class="form-control" readonly/>
                        </div>
                    </div>
                </div>
                <div class="space-6"></div>
                <div class="row">
                    <div class="col-sm-3">
                        <div class="input-group">
                            <span class="input-group-addon">开始时间</span>
                            <input id="Create_Date" type="text" class="form-control" readonly/>
                        </div>
                    </div>
                    <div class="col-sm-3">
                        <div class="input-group">
                            <span class="input-group-addon">结束时间</span>
                            <input id="End_Date" type="text" class="form-control" readonly/>
                        </div>
                    </div>
                    <div class="col-sm-3">
                        <div class="input-group">
                            <span class="input-group-addon">直播时长</span>
                            <input id="Duration" type="text" class="form-control" readonly/>
                        </div>
                    </div>
                    <div class="col-sm-3">
                        <div class="input-group">
                            <span class="input-group-addon">创建IP</span>
                            <input id="Create_IP" type="text" class="form-control" readonly/>
                        </div>
                    </div>
                </div>
            </div>
            <div id="MenuTabs_Gift" class="tab-pane">
                <table id="dtpGift" class="dataTable">
                    <tfoot>
                    <tr>
                        <td colspan="4">本页合计：</td>
                        <td>
                            <span name="Order_Num"/>
                        </td>
                        <td>
                            <span name="Order_Amt" class="tooltip-"/>
                        </td>
                        <td>
                            <span name="Order_Amt_Anchor" class="tooltip-"/>
                        </td>
                        <td>
                            <span name="Order_Amt_Family" class="tooltip-"/>
                        </td>
                        <td>
                            <span name="Order_Amt_Platform" class="tooltip-"/>
                        </td>
                        <td></td>
                    </tr>
                    </tfoot>
                </table>
                <div id="dtpGift_filter" class="dataTables_filter">
                    <div>
                        <input id="dtpGift_F_SValue" class="fvalue" type="text" placeholder="单据号、礼物名"/>
                        <input id="dtpGift_F_UserID" type="text" style="width: 76px;" placeholder="送出人">
                        <label>-</label>
                        <input id="dtpGift_F_UserIDGift" type="text" style="width: 76px;" placeholder="接收人">
                        <input id="dtpGift_F_StartDate" type="text" style="width: 76px;" placeholder="交易时间">
                        <label>-</label>
                        <input id="dtpGift_F_EndDate" type="text" style="width: 76px;" placeholder="结束时间">
                        <select id="dtpGift_F_SelectDate"></select>
                        <button id="dtpGift_F_Btn"></button>
                    </div>
                </div>
            </div>
            <div id="MenuTabs_Guardian" class="tab-pane">
                <table id="dtpGuardian" class="dataTable">
                    <tfoot>
                    <tr>
                        <td colspan="5">本页合计：</td>
                        <td>
                            <span name="Order_Amt" class="tooltip-"/>
                        </td>
                        <td>
                            <span name="Order_Amt_Anchor" class="tooltip-"/>
                        </td>
                        <td>
                            <span name="Order_Amt_Family" class="tooltip-"/>
                        </td>
                        <td>
                            <span name="Order_Amt_Platform" class="tooltip-"/>
                        </td>
                        <td></td>
                    </tr>
                    </tfoot>
                </table>
                <div id="dtpGuardian_filter" class="dataTables_filter">
                    <div>
                        <input id="dtpGuardian_F_SValue" class="fvalue" type="text" placeholder="单号、守护名"/>
                        <select id="dtpGuardian_F_Family" style="width: 186px;" data-databind="Family"></select>
                        <input id="dtpGuardian_F_UserID" type="text" style="width: 76px;" placeholder="守护人ID">
                        <input id="dtpGuardian_F_UserIDGuardian" type="text" style="width: 76px;" placeholder="被守护人ID">
                        <input id="dtpGuardian_F_StartDate" type="text" style="width: 76px;" placeholder="开始时间">
                        <label>-</label>
                        <input id="dtpGuardian_F_EndDate" type="text" style="width: 76px;" placeholder="结束时间">
                        <select id="dtpGuardian_F_SelectDate"></select>
                        <button id="dtpGuardian_F_Btn"></button>
                    </div>
                </div>
            </div>
            <div id="MenuTabs_Horn" class="tab-pane">
                <table id="dtpHorn" class="dataTable">
                    <tfoot>
                    <tr>
                        <td colspan="6">本页合计：</td>
                        <td>
                            <span name="Order_Amt" class="tooltip-"/>
                        </td>
                        <td>
                            <span name="Order_Amt_Anchor" class="tooltip-"/>
                        </td>
                        <td>
                            <span name="Order_Amt_Family" class="tooltip-"/>
                        </td>
                        <td>
                            <span name="Order_Amt_Platform" class="tooltip-"/>
                        </td>
                        <td></td>
                    </tr>
                    </tfoot>
                </table>
                <div id="dtpHorn_filter" class="dataTables_filter">
                    <input id="dtpHorn_F_SValue" class="fvalue" type="text" placeholder="单号"/>
                    <select id="dtpHorn_F_Family" style="width: 186px;" data-databind="Family"></select>
                    <input id="dtpHorn_F_UserID" type="text" style="width: 56px;" placeholder="发送人ID">
                    <input id="dtpHorn_F_StartDate" type="text" style="width: 76px;" placeholder="开始时间">
                    <label>-</label>
                    <input id="dtpHorn_F_EndDate" type="text" style="width: 76px;" placeholder="结束时间">
                    <select id="dtpHorn_F_SelectDate"></select>
                    <button id="dtpHorn_F_Btn"></button>
                </div>
            </div>
        </div>
    </div>
    <div class="divColorbox_Footer">
        <div id="divPaginate_Gift" class="Paginate" MenuTabs="#MenuTabs_Gift"></div>
        <div id="divPaginate_Guardian" class="Paginate" MenuTabs="#MenuTabs_Guardian"></div>
        <div id="divPaginate_Horn" class="Paginate" MenuTabs="#MenuTabs_Horn"></div>
        <button type="button" id="btnUndo"></button>
    </div>
</div>
<script src="<%- Virtual_Path.Static %>jquery.plugin/dataTables/jquery.dataTables.min.js"></script>
<script src="<%- Virtual_Path.Static %>jquery.plugin/dataTables/jquery.dataTables.bootstrap.min.js"></script>
<script>
    $(function () {
        //region 判断flag
        if (_PageData.flag !== 0) {
            $.KOC.Tips.Open('Error', _PageData.flag, {
                Timeout: 1000,
                onClose: function () {
                    parent.$.colorbox.close();
                }
            });
            return;
        }
        //endregion
        //region 页面数据绑定
        $('#Order_No').val(_PageData.Order_No);
        $('#User_ID').val(_PageData.Order_Live.User_ID);
        $('#NickName').val(_PageData.Order_Live.User_NickName);
        $('#RealName').val(_PageData.Order_Live.User_RealName);
        $('#IsMobile').val(_PageData.Order_Live.IsMobile ? '手机直播' : 'PC端直播');
        switch (_PageData.Order_Live.Mode) {
            case 0:
                $('#Mode').val('PC直播');
                break;
            case 11:
                $('#Mode').val('手机直播(竖屏)');
                break;
            case 12:
                $('#Mode').val('手机直播(横屏)');
                break;
        }
        $('#Coin').val(_PageData.Order_Live.Coin);
        $('#Beans_Anchor').val(_PageData.Order_Live.Beans_Anchor);
        $('#Beans_Family').val(_PageData.Order_Live.Beans_Family);
        $('#Beans_User').val(_PageData.Order_Live.Beans_User);
        $('#Beans_UserFamily').val(_PageData.Order_Live.Beans_UserFamily);
        $('#Beans_Platform').val(_PageData.Order_Live.Beans_Platform);

        $('#Gift_Num').val(_PageData.Order_Live.Gift_Num);
        $('#Gift_Num_Anchor').val(_PageData.Order_Live.Gift_Num_Anchor);
        $('#Gift_Num_User').val(_PageData.Order_Live.Gift_Num_User);

        $('#Gift_Count').val(_PageData.Order_Live.Gift_Count);
        $('#Gift_Count_Anchor').val(_PageData.Order_Live.Gift_Count_Anchor);
        $('#Gift_Count_User').val(_PageData.Order_Live.Gift_Count_User);

        $('#Gift_Coin').val(_PageData.Order_Live.Gift_Coin);
        $('#Gift_Coin_Anchor').val(_PageData.Order_Live.Gift_Coin_Anchor);
        $('#Gift_Coin_User').val(_PageData.Order_Live.Gift_Coin_User);

        $('#Gift_Beans_Anchor').val(_PageData.Order_Live.Gift_Beans_Anchor);
        $('#Gift_Beans_Family').val(_PageData.Order_Live.Gift_Beans_Family);
        $('#Gift_Beans_User').val(_PageData.Order_Live.Gift_Beans_User);
        $('#Gift_Beans_UserFamily').val(_PageData.Order_Live.Gift_Beans_UserFamily);
        $('#Gift_Beans_Platform').val(_PageData.Order_Live.Gift_Beans_Platform);

        $('#Gift_Pond_Count').val(_PageData.Order_Live.Gift_Pond_Count);
        $('#Gift_Pond_Coin').val(_PageData.Order_Live.Gift_Pond_Coin);

        $('#Guardian_Count').val(_PageData.Order_Live.Guardian_Count);
        $('#Guardian_Coin').val(_PageData.Order_Live.Guardian_Coin);
        $('#Guardian_Beans_Anchor').val(_PageData.Order_Live.Guardian_Beans_Anchor);
        $('#Guardian_Beans_Family').val(_PageData.Order_Live.Guardian_Beans_Family);
        $('#Guardian_Beans_Platform').val(_PageData.Order_Live.Guardian_Beans_Platform);

        $('#Horn_Count').val(_PageData.Order_Live.Horn_Count);
        $('#Horn_Coin').val(_PageData.Order_Live.Horn_Coin);
        $('#Horn_Beans_Anchor').val(_PageData.Order_Live.Horn_Beans_Anchor);
        $('#Horn_Beans_Family').val(_PageData.Order_Live.Horn_Beans_Family);
        $('#Horn_Beans_Platform').val(_PageData.Order_Live.Horn_Beans_Platform);

        $('#Pomelo').val(_PageData.Order_Live.Pomelo);
        $('#Duration').val(_PageData.Order_Live.Duration);


        $('#Create_Date').val(moment(_PageData.Order_Live.Create_Date).format('YYYY/MM/DD HH:mm:ss'));
        $('#End_Date').val(_PageData.Order_Live.End_Date ? moment(_PageData.Order_Live.End_Date).format('YYYY/MM/DD HH:mm:ss') : '');
        $('#Create_IP').val(_PageData.Order_Live.Create_IP);

        $('#Status').val(_PageData.Order_Live.Status ? '直播' : '结束');

        if (_PageData.Order_Live.User_ID) {
            $('#btnUserInfo').click(function () {
                $.CommonAdmin.OpenWindow(':UserInfo:' + _PageData.Order_Live.User_ID);
            });
        } else {
            $('#btnUserInfo').remove();
        }

        //endregion
        //region 时间输入框插件
        $('#dtpGift_F_StartDate, #dtpGift_F_EndDate, #dtpGuardian_F_StartDate, #dtpGuardian_F_EndDate').datetimepicker({
            language: 'zh-CN',
            format: 'yyyy-mm-dd',
            minView: 2,
            autoclose: true
        });
        //endregion
        //region 绑定日期选择框
        $.KOC.Date.Select.Bind({
            eSelect: $('#dtpGift_F_SelectDate, #dtpGuardian_F_SelectDate'),
            eBegin: $('#dtpGift_F_StartDate, #dtpGuardian_F_StartDate'),
            eEnd: $('#dtpGift_F_EndDate, #dtpGuardian_F_EndDate')
        });
        //endregion
        //region 礼物
        $("#dtpGift").dataTable({
            'aoColumns': [
                {
                    'sWidth': '120px', 'data': 'Order_No', 'sName': 'Order_No', 'sTitle': "单据号", 'sClass': 'center',
                    'createdCell': function (td, cellData) {
                        $(td).html($('<a/>').attr('data-openwindow', cellData).text(cellData));
                    }
                },
                {
                    'sWidth': '10%', 'data': 'User_ID', 'sName': 'User_ID', 'sTitle': '送出人', 'sClass': 'center t-left',
                    'createdCell': function (td, cellData, rowData) {
                        $(td).html($('<a/>').attr('data-openwindow', ':UserInfo:' + cellData).text(rowData.User_NickName));
                    }
                },
                {
                    'sWidth': '10%', 'data': 'User_ID_Gift', 'sTitle': '接收人', 'sClass': 'center t-left',
                    'createdCell': function (td, cellData, rowData) {
                        $(td).html($('<a/>').attr('data-openwindow', ':UserInfo:' + cellData).text(rowData.User_NickName_Gift));
                    }
                },
                {
                    'sWidth': '12%', 'data': 'Gift_Name', 'sTitle': '礼物名称', 'sClass': 'center t-left', bSortable: false,
                    'createdCell': function (td, cellData, rowData) {
                        var _html = cellData;
                        if (rowData.Lucky) {
                            _html += ' <i class="fa fa-star bigger-120 purple" data-rel="tooltip" data-original-title="幸运礼物" />';
                        }
                        if (rowData.IsTask) {
                            _html += ' <i class="fa fa-tasks bigger-120 red" data-rel="tooltip" data-original-title="任务礼物" />';
                        }
                        $(td).html(_html);
                    }
                },
                {
                    'sWidth': '75px', 'data': 'Order_Num', 'sName': 'Order_Num', 'sTitle': '数量', 'sClass': 'center t-right'
                },
                {
                    'sWidth': '93px', 'data': 'Order_Amt', 'sName': 'Order_Amt', 'sTitle': '金额', 'sClass': 'center t-right',
                    'createdCell': function (td, cellData) {
                        if (cellData > 0) {
                            $(td).html('<span class="tooltip-" data-rel="tooltip" data-original-title="金币价值：' + $.KOC.String.ToCurrencyPositiveStr(cellData / 1000) + '">' + cellData + '</span>');
                        }
                    }
                },
                {
                    'sWidth': '93px', 'data': 'Order_Amt_Anchor', 'sName': 'Order_Amt_Anchor', 'sTitle': '艺人收入', 'sClass': 'center t-right',
                    'createdCell': function (td, cellData) {
                        if (cellData > 0) {
                            $(td).html('<span class="tooltip-" data-rel="tooltip" data-original-title="金币价值：' + $.KOC.String.ToCurrencyPositiveStr(cellData / 1000) + '">' + cellData + '</span>');
                        }
                    }
                },
                {
                    'sWidth': '93px', 'data': 'Order_Amt_Family', 'sName': 'Order_Amt_Family', 'sTitle': '公会收入', 'sClass': 'center t-right',
                    'createdCell': function (td, cellData) {
                        if (cellData > 0) {
                            $(td).html('<span class="tooltip-" data-rel="tooltip" data-original-title="金币价值：' + $.KOC.String.ToCurrencyPositiveStr(cellData / 1000) + '">' + cellData + '</span>');
                        }
                    }
                },
                {
                    'sWidth': '93px', 'data': 'Order_Amt_Platform', 'sName': 'Order_Amt_Platform', 'sTitle': '平台收入', 'sClass': 'center t-right',
                    'createdCell': function (td, cellData) {
                        if (cellData > 0) {
                            $(td).html('<span class="tooltip-" data-rel="tooltip" data-original-title="金币价值：' + $.KOC.String.ToCurrencyPositiveStr(cellData / 1000) + '">' + cellData + '</span>');
                        }
                    }
                },
                {
                    'sWidth': '13%', 'data': 'Create_Date', 'sName': 'Order_No', 'sTitle': '时间', 'sClass': 'center',
                    'createdCell': function (td, cellData) {
                        $(td).text(moment(cellData).format('YY/MM/DD HH:mm'));
                    }
                }
            ],
            'aaSorting': [0, 'desc'],
            'sAjaxSource': '/ajax/user.page.ordergift',
            'PaginateElement': $('#divPaginate_Gift'),
            'fnServerParams': function (aoData) {
                if (!this.arrPageFilter) {
                    this.arrPageFilter = {
                        F_LiveOrderNo: _PageData.Order_No,
                        F_UserID: $(this.selector + '_F_UserID').val(),
                        F_UserIDGift: $(this.selector + '_F_UserIDGift').val(),
                        F_StartDate: $(this.selector + '_F_StartDate').val(),
                        F_EndDate: $(this.selector + '_F_EndDate').val()
                    };
                } else {
                    $(this.selector + '_F_UserID').val(this.arrPageFilter.F_UserID);
                    $(this.selector + '_F_UserIDGift').val(this.arrPageFilter.F_UserIDGift);
                    $(this.selector + '_F_StartDate').val(this.arrPageFilter.F_StartDate);
                    $(this.selector + '_F_EndDate').val(this.arrPageFilter.F_EndDate);
                }
                this.ofnServerParams(aoData);
            },
            'fnFooterCallback': function (nFoot, aData) {
                var _FooterData = {
                    Order_Num: 0,
                    Order_Amt: 0,
                    Order_Amt_Anchor: 0,
                    Order_Amt_Family: 0,
                    Order_Amt_Platform: 0
                };
                _.forEach(aData, function (ThisValue) {
                    _FooterData.Order_Num += ThisValue.Order_Num;
                    _FooterData.Order_Amt += ThisValue.Order_Amt;
                    _FooterData.Order_Amt_Anchor += ThisValue.Order_Amt_Anchor;
                    _FooterData.Order_Amt_Family += ThisValue.Order_Amt_Family;
                    _FooterData.Order_Amt_Platform += ThisValue.Order_Amt_Platform;
                });
                $(nFoot).find('[name="Order_Num"]').text(_FooterData.Order_Num);
                $(nFoot).find('[name="Order_Amt"]').attr({
                    'data-rel': 'tooltip',
                    'data-original-title': '金币价值总计：' + $.KOC.String.ToCurrencyPositiveStr(_FooterData.Order_Amt / 1000)
                }).text(_FooterData.Order_Amt);
                $(nFoot).find('[name="Order_Amt_Anchor"]').attr({
                    'data-rel': 'tooltip',
                    'data-original-title': '金币价值总计：' + $.KOC.String.ToCurrencyPositiveStr(_FooterData.Order_Amt_Anchor / 1000)
                }).text(_FooterData.Order_Amt_Anchor);
                $(nFoot).find('[name="Order_Amt_Family"]').attr({
                    'data-rel': 'tooltip',
                    'data-original-title': '金币价值总计：' + $.KOC.String.ToCurrencyPositiveStr(_FooterData.Order_Amt_Family / 1000)
                }).text(_FooterData.Order_Amt_Family);
                $(nFoot).find('[name="Order_Amt_Platform"]').attr({
                    'data-rel': 'tooltip',
                    'data-original-title': '金币价值总计：' + $.KOC.String.ToCurrencyPositiveStr(_FooterData.Order_Amt_Platform / 1000)
                }).text(_FooterData.Order_Amt_Platform);
            },
            'fnDrawCallback': function () {
                $.Common.Bootstrap.Tooltip(this);
                this.ofnDrawCallback();
            },
            'selectOpt': false
        });
        //endregion
        //region 守护
        $("#dtpGuardian").dataTable({
            'aoColumns': [
                {
                    'sWidth': '120px', 'data': 'Order_No', 'sName': 'Order_No', 'sTitle': "单据号", 'sClass': 'center',
                    'createdCell': function (td, cellData) {
                        $(td).html($('<a/>').attr('data-openwindow', cellData).text(cellData));
                    }
                },
                {
                    'sWidth': '16%', 'data': 'Family_Name', 'sName': 'Family_ID', 'sTitle': '公会名', 'sClass': 'center t-left'
                },
                {
                    'sWidth': '10%', 'data': 'User_ID', 'sName': 'User_ID', 'sTitle': '守护人', 'sClass': 'center t-left',
                    'createdCell': function (td, cellData, rowData) {
                        $(td).html($('<a/>').attr('data-openwindow', ':UserInfo:' + cellData).text(rowData.User_NickName));
                    }
                },
                {
                    'sWidth': '10%', 'data': 'User_ID_Guardian', 'sTitle': '被守护人', 'sClass': 'center t-left',
                    'createdCell': function (td, cellData, rowData) {
                        $(td).html($('<a/>').attr('data-openwindow', ':UserInfo:' + cellData).text(rowData.User_NickName_Guardian));
                    }
                },
                {
                    'data': 'Guardian_Name', 'sTitle': '守护名称', 'sClass': 'center t-left', bSortable: false
                },
                {
                    'sWidth': '93px', 'data': 'Order_Amt', 'sName': 'Order_Amt', 'sTitle': '金额', 'sClass': 'center t-right',
                    'createdCell': function (td, cellData) {
                        if (cellData > 0) {
                            $(td).html('<span class="tooltip-" data-rel="tooltip" data-original-title="金币价值：' + $.KOC.String.ToCurrencyPositiveStr(cellData / 1000) + '">' + cellData + '</span>');
                        }
                    }
                },
                {
                    'sWidth': '93px', 'data': 'Order_Amt_Anchor', 'sName': 'Order_Amt_Anchor', 'sTitle': '艺人收入', 'sClass': 'center t-right',
                    'createdCell': function (td, cellData) {
                        if (cellData > 0) {
                            $(td).html('<span class="tooltip-" data-rel="tooltip" data-original-title="金币价值：' + $.KOC.String.ToCurrencyPositiveStr(cellData / 1000) + '">' + cellData + '</span>');
                        }
                    }
                },
                {
                    'sWidth': '93px', 'data': 'Order_Amt_Family', 'sName': 'Order_Amt_Family', 'sTitle': '公会收入', 'sClass': 'center t-right',
                    'createdCell': function (td, cellData) {
                        if (cellData > 0) {
                            $(td).html('<span class="tooltip-" data-rel="tooltip" data-original-title="金币价值：' + $.KOC.String.ToCurrencyPositiveStr(cellData / 1000) + '">' + cellData + '</span>');
                        }
                    }
                },
                {
                    'sWidth': '93px', 'data': 'Order_Amt_Platform', 'sName': 'Order_Amt_Platform', 'sTitle': '平台收入', 'sClass': 'center t-right',
                    'createdCell': function (td, cellData) {
                        if (cellData > 0) {
                            $(td).html('<span class="tooltip-" data-rel="tooltip" data-original-title="金币价值：' + $.KOC.String.ToCurrencyPositiveStr(cellData / 1000) + '">' + cellData + '</span>');
                        }
                    }
                },
                {
                    'sWidth': '13%', 'data': 'Create_Date', 'sName': 'Order_No', 'sTitle': '时间', 'sClass': 'center',
                    'createdCell': function (td, cellData) {
                        $(td).text(moment(cellData).format('YY/MM/DD HH:mm'));
                    }
                }
            ],
            'aaSorting': [0, 'desc'],
            'sAjaxSource': '/ajax/user.page.orderguardian',
            'PaginateElement': $('#divPaginate_Guardian'),
            'fnServerParams': function (aoData) {
                if (!this.arrPageFilter) {
                    this.arrPageFilter = {
                        F_LiveOrderNo: _PageData.Order_No,
                        F_Family: $(this.selector + '_F_Family').val(),
                        F_UserID: $(this.selector + '_F_UserID').val(),
                        F_UserIDGuardian: $(this.selector + '_F_UserIDGuardian').val(),
                        F_StartDate: $(this.selector + '_F_StartDate').val(),
                        F_EndDate: $(this.selector + '_F_EndDate').val()
                    };
                } else {
                    $(this.selector + '_F_Family').val(this.arrPageFilter.F_Family);
                    $(this.selector + '_F_UserID').val(this.arrPageFilter.F_UserID);
                    $(this.selector + '_F_UserIDGuardian').val(this.arrPageFilter.F_UserIDGuardian);
                    $(this.selector + '_F_StartDate').val(this.arrPageFilter.F_StartDate);
                    $(this.selector + '_F_EndDate').val(this.arrPageFilter.F_EndDate);
                }
                this.ofnServerParams(aoData);
            },
            'fnFooterCallback': function (nFoot, aData) {
                var _FooterData = {
                    Order_Amt: 0,
                    Order_Amt_Anchor: 0,
                    Order_Amt_Family: 0,
                    Order_Amt_Platform: 0
                };
                _.forEach(aData, function (ThisValue) {
                    _FooterData.Order_Amt += ThisValue.Order_Amt;
                    _FooterData.Order_Amt_Anchor += ThisValue.Order_Amt_Anchor;
                    _FooterData.Order_Amt_Family += ThisValue.Order_Amt_Family;
                    _FooterData.Order_Amt_Platform += ThisValue.Order_Amt_Platform;
                });
                $(nFoot).find('[name="Order_Amt"]').attr({
                    'data-rel': 'tooltip',
                    'data-original-title': '金币价值总计：' + $.KOC.String.ToCurrencyPositiveStr(_FooterData.Order_Amt / 1000)
                }).text(_FooterData.Order_Amt);
                $(nFoot).find('[name="Order_Amt_Anchor"]').attr({
                    'data-rel': 'tooltip',
                    'data-original-title': '金币价值总计：' + $.KOC.String.ToCurrencyPositiveStr(_FooterData.Order_Amt_Anchor / 1000)
                }).text(_FooterData.Order_Amt_Anchor);
                $(nFoot).find('[name="Order_Amt_Family"]').attr({
                    'data-rel': 'tooltip',
                    'data-original-title': '金币价值总计：' + $.KOC.String.ToCurrencyPositiveStr(_FooterData.Order_Amt_Family / 1000)
                }).text(_FooterData.Order_Amt_Family);
                $(nFoot).find('[name="Order_Amt_Platform"]').attr({
                    'data-rel': 'tooltip',
                    'data-original-title': '金币价值总计：' + $.KOC.String.ToCurrencyPositiveStr(_FooterData.Order_Amt_Platform / 1000)
                }).text(_FooterData.Order_Amt_Platform);
            },
            'fnDrawCallback': function () {
                $.Common.Bootstrap.Tooltip(this);
                this.ofnDrawCallback();
            },
            'selectOpt': false
        });
        //endregion
        //region 喇叭
        $("#dtpHorn").dataTable({
            'aoColumns': [
                {
                    'sWidth': '120px', 'data': 'Order_No', 'sName': 'Order_No', 'sTitle': "单据号", 'sClass': 'center',
                    'createdCell': function (td, cellData) {
                        $(td).html($('<a/>').attr('data-openwindow', cellData).text(cellData));
                    }
                },
                {
                    'sWidth': '75px', 'data': 'User_ID_Anchor', 'sName': 'User_ID_Anchor', 'sTitle': '房间ID', 'sClass': 'center',
                    'createdCell': function (td, cellData) {
                        $(td).html($('<a/>').attr('data-openwindow', ':UserAnchorInfo:' + cellData).text(cellData));
                    }
                },
                {
                    'sWidth': '12%', 'data': 'User_NickName_Anchor', 'sName': 'User_ID_Anchor', 'sTitle': '艺人', 'sClass': 'center t-left'
                },
                {
                    'sWidth': '12%', 'data': 'Family_Name', 'sName': 'Family_ID', 'sTitle': '公会名', 'sClass': 'center t-left'
                },
                {
                    'sWidth': '10%', 'data': 'User_ID', 'sName': 'User_ID', 'sTitle': '发送人', 'sClass': 'center t-left',
                    'createdCell': function (td, cellData, rowData) {
                        $(td).html($('<a/>').attr('data-openwindow', ':UserInfo:' + cellData).text(rowData.User_NickName));
                    }
                },
                {
                    'sWidth': '70px', 'data': 'Horn_Mode', 'sTitle': "模式", 'sClass': 'center', 'bSortable': false,
                    'createdCell': function (td, cellData) {
                        switch (cellData) {
                            case "ROOM":
                                $(td).html('<i class="fa fa-fighter-jet bigger-120" data-rel="tooltip" data-original-title="飞屏" />');
                                break;
                            case "SERVER":
                                $(td).html('<i class="fa fa-bullhorn bigger-120" data-rel="tooltip" data-original-title="喇叭" />');
                                break;
                            default:
                                $(td).html('<i class="fa fa-question bigger-120" data-rel="tooltip" data-original-title="未知" />');
                                break;
                        }
                    }
                },
                {
                    'sWidth': '93px', 'data': 'Order_Amt', 'sName': 'Order_Amt', 'sTitle': '金额', 'sClass': 'center t-right',
                    'createdCell': function (td, cellData) {
                        if (cellData > 0) {
                            $(td).html('<span class="tooltip-" data-rel="tooltip" data-original-title="金币价值：' + $.KOC.String.ToCurrencyPositiveStr(cellData / 1000) + '">' + cellData + '</span>');
                        }
                    }
                },
                {
                    'sWidth': '93px', 'data': 'Order_Amt_Anchor', 'sName': 'Order_Amt_Anchor', 'sTitle': '艺人收入', 'sClass': 'center t-right',
                    'createdCell': function (td, cellData) {
                        if (cellData > 0) {
                            $(td).html('<span class="tooltip-" data-rel="tooltip" data-original-title="金币价值：' + $.KOC.String.ToCurrencyPositiveStr(cellData / 1000) + '">' + cellData + '</span>');
                        }
                    }
                },
                {
                    'sWidth': '93px', 'data': 'Order_Amt_Family', 'sName': 'Order_Amt_Family', 'sTitle': '公会收入', 'sClass': 'center t-right',
                    'createdCell': function (td, cellData) {
                        if (cellData > 0) {
                            $(td).html('<span class="tooltip-" data-rel="tooltip" data-original-title="金币价值：' + $.KOC.String.ToCurrencyPositiveStr(cellData / 1000) + '">' + cellData + '</span>');
                        }
                    }
                },
                {
                    'sWidth': '93px', 'data': 'Order_Amt_Platform', 'sName': 'Order_Amt_Platform', 'sTitle': '平台收入', 'sClass': 'center t-right',
                    'createdCell': function (td, cellData) {
                        if (cellData > 0) {
                            $(td).html('<span class="tooltip-" data-rel="tooltip" data-original-title="金币价值：' + $.KOC.String.ToCurrencyPositiveStr(cellData / 1000) + '">' + cellData + '</span>');
                        }
                    }
                },
                {
                    'sWidth': '10%', 'data': 'Create_Date', 'sName': 'Order_No', 'sTitle': '时间', 'sClass': 'center',
                    'createdCell': function (td, cellData) {
                        $(td).text(moment(cellData).isValid() ? moment(cellData).format('YY/MM/DD HH:mm') : '');
                    }
                }
            ],
            'aaSorting': [0, 'desc'],
            'sAjaxSource': '/ajax/user.page.orderhorn',
            'PaginateElement': $('#divPaginate_Horn'),
            'fnServerParams': function (aoData) {
                if (!this.arrPageFilter) {
                    this.arrPageFilter = {
                        F_LiveOrderNo: _PageData.Order_No,
                        F_Family: $(this.selector + '_F_Family').val(),
                        F_UserID: $(this.selector + '_F_UserID').val(),
                        F_UserIDAnchor: $(this.selector + '_F_UserIDAnchor').val(),
                        F_StartDate: $(this.selector + '_F_StartDate').val(),
                        F_EndDate: $(this.selector + '_F_EndDate').val()
                    };
                } else {
                    $(this.selector + '_F_Family').val(this.arrPageFilter.F_Family);
                    $(this.selector + '_F_UserID').val(this.arrPageFilter.F_UserID);
                    $(this.selector + '_F_UserIDAnchor').val(this.arrPageFilter.F_UserIDAnchor);
                    $(this.selector + '_F_StartDate').val(this.arrPageFilter.F_StartDate);
                    $(this.selector + '_F_EndDate').val(this.arrPageFilter.F_EndDate);
                }
                this.ofnServerParams(aoData);
            },
            'fnFooterCallback': function (nFoot, aData) {
                var _FooterData = {
                    Order_Amt: 0,
                    Order_Amt_Anchor: 0,
                    Order_Amt_Family: 0,
                    Order_Amt_Platform: 0
                };
                _.forEach(aData, function (ThisValue) {
                    _FooterData.Order_Amt += ThisValue.Order_Amt;
                    _FooterData.Order_Amt_Anchor += ThisValue.Order_Amt_Anchor;
                    _FooterData.Order_Amt_Family += ThisValue.Order_Amt_Family;
                    _FooterData.Order_Amt_Platform += ThisValue.Order_Amt_Platform;
                });
                $(nFoot).find('[name="Order_Amt"]').attr({
                    'data-rel': 'tooltip',
                    'data-original-title': '金币价值总计：' + $.KOC.String.ToCurrencyPositiveStr(_FooterData.Order_Amt / 1000)
                }).text(_FooterData.Order_Amt);
                $(nFoot).find('[name="Order_Amt_Anchor"]').attr({
                    'data-rel': 'tooltip',
                    'data-original-title': '金币价值总计：' + $.KOC.String.ToCurrencyPositiveStr(_FooterData.Order_Amt_Anchor / 1000)
                }).text(_FooterData.Order_Amt_Anchor);
                $(nFoot).find('[name="Order_Amt_Family"]').attr({
                    'data-rel': 'tooltip',
                    'data-original-title': '金币价值总计：' + $.KOC.String.ToCurrencyPositiveStr(_FooterData.Order_Amt_Family / 1000)
                }).text(_FooterData.Order_Amt_Family);
                $(nFoot).find('[name="Order_Amt_Platform"]').attr({
                    'data-rel': 'tooltip',
                    'data-original-title': '金币价值总计：' + $.KOC.String.ToCurrencyPositiveStr(_FooterData.Order_Amt_Platform / 1000)
                }).text(_FooterData.Order_Amt_Platform);
            },
            'fnDrawCallback': function () {
                $.Common.Bootstrap.Tooltip(this);
                this.ofnDrawCallback();
            },
            'selectOpt': false
        });
        //endregion
    });
</script>